<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Vue-resource的基本使用</title>
	<script src="js/vue.js"></script>
	
	<!-- 注意：vue-resource依赖于vue,所以先后顺序要注意-->
	<script src="js/vue-resource.js"></script>
</head>
<body>
	<div id="app">
		<input type="button" value="get请求" @click="getInfo"/>
	</div>
	
	<script type="text/javascript">
		var vm = new Vue({
			el: '#app',
			data: {
			},
			methods: {
				getInfo(){
					// 发起get请求
					this.$http.get("https://www.baidu.com/sugrec?prod=pc&from=pc_web&wd=郭").then(function (result){
						console.log("-----"+result.body);
						console.log("==="+result);
						console.log("++++"+result.data);
					});
				},
			},
			
		});
	</script>
</body>
</html>
